#ifndef VNODE_MAP_H_
#define VNODE_MAP_H_

#include <dirent.h>
#include "vnode.h"

class VNodeReal : public VNode {
private:
	std::string m_path;

public:
	VNodeReal(const char *path, bool dir = false);

	const char *get_real_path() const;

	bool is_real() const;
};

class VNodeDirMap : public VNodeDir {
private:
	std::string m_targ_path;
	DIR *m_dir;
	std::vector<VNode*> m_real_nodes;

	VNode *lookup(char *path);

public:
	VNodeDirMap();
	~VNodeDirMap();

	bool open(const char *path);
	void close();

	bool is_open() const;

	friend VNode *lookup_path(const char *path);
};

#endif	// VNODE_MAP_H_
